1. Field of the Invention
The present invention relates to a method of synchronizing clocks in devices that transmit and receive data frames via a network, and to relevant systems and apparatus.
2. Description of the Related Art
Methods of synchronizing clocks in devices that exchange data frames over the Internet or another communication network are well known. Exemplary methods and apparatus are disclosed by Inomata in Japanese Patent Application Publication (JP) 2010-190635. These and many other known methods use the Precision Time Protocol (PTP) defined by the Institute of Electrical and Electronics Engineers (IEEE) in its 1588 family of standards.
The IEEE 1588-2002 standard defines Sync, FollowUp, DelayReq, and DelayResp messages for use in clock synchronization. Sync and DelayReq messages are timestamped when transmitted and received, and the transmitting or receiving device stores the timestamp. Conventionally, each transmitted or received frame is analyzed in an interface layer such as a media independent interface (MII) or gigabit media independent interface (GMII) layer, and a timestamp is generated and stored if the frame includes a Sync or DelayReq message.
A problem with this conventional timestamping method is that analyzing all outgoing frames on the MII or other interface to decide which frames include a Sync or DelayReq message involves a considerable processing load. The time taken to perform the analysis also lowers the precision of the timestamp. A similar problem occurs in frame reception: before storing the timestamp of a frame, the receiving apparatus must analyze the frame on the MII or other interface to determine whether the frame includes a Sync or DelayReq message, and the precision of the timestamp is reduced by the time required for the analysis. These problems make it difficult to determine the network latency precisely, which is necessary for precise clock synchronization.
The problems are aggravated when security protection is employed. If the IEEE 802.1AE Media Access Control Security (MACsec) standard is used, as discussed by Ida et al. in JP 2008-42715, for example, frames on the MII or other interface are encrypted and defy analysis. The present inventor considered having the timestamp of a MACsec frame stored before the frame is encrypted at the transmitting end and after the frame is decrypted at the receiving end, but that would further lower the timestamp precision, because the time required for encryption and decryption would be added to the intrinsic network latency.